provider "alicloud" {
  region     = var.region
  access_key = "LTAI5tNzyFbBDDCmDDtPKRqu"
  secret_key = "3iwQ8wKDjR1MGz1XtDPdBVxOMF9MKj"
}

module "vpc" {
  source       = "registry.cloudiac.org/idcos/vpc/alicloud"
  version      = "1.0.2"
  vpc_name     = var.vpc_name
  vpc_cidr     = var.vpc_cidr_block
  vswitch_name = var.vswitch_name
  vswitch_cidr = var.vswitch_cidr_block
}

resource "alicloud_nat_gateway" "enhanced" {
  vpc_id           = module.vpc.vpc_id
  nat_gateway_name = var.nat_gateway_name
  payment_type     = var.payment_type
  vswitch_id       = module.vpc.vswitch_ids
  nat_type         = var.nat_type
}